
import {createPage,high} from 'nc-lightapp-front';
import {render} from '../../../../hrpub/common/frame';
import MainAction from '../actions/main';
import BtnAction from '../actions/btn.js';
import Table from '../components/table/index';
import Form from '../components/form/index';
import DimissionModal from '../components/dimissionModal';
import './index.less';
import PubAction from '../actions/pub';
import Header from '../components/header/index';
import HeadAction from '../components/header/actions/header.js';
import { getAppPageConfig, handleHash } from '../../../../hrpub/common/utils/utils';


const {PrintOutput} = high



const MainPage = render({
    actions: {
        mainAction: MainAction,
        btnAction: BtnAction,
        pubAction: PubAction,
        headAction: HeadAction
    }
})(({props, action, state}) => { 
    const {main,search} = props
    const {NCCreateSearch} = search
    const dom = JSON.stringify(main.json) !=='{}'? 
        <React.Fragment>
            <div className="nc-bill-card">
                <Header
                    {...props}
                />
                <Table
                    {...props}
                />

                <Form
                    {...props}
                />
                <DimissionModal 
                    {...props}
                />
            </div>
        </React.Fragment> : null

    return(
        <React.Fragment>
            {dom}
            <div style={{display:'none'}}>
                {NCCreateSearch('query',{
                    clickSearchBtn: action.btnAction.searchBtn
                })}
            </div>
            
            
          
        </React.Fragment>
    )
}) 


export default createPage({
    billinfo:{
        billtype: 'card', 
        pagecode: getAppPageConfig().appcode, 
        headcode: 'card',
        bodycode: 'handover'
    }
})(handleHash('2019', 'c=60092080&p=60092080')(MainPage));